import service from "../config"

// 创建会话
export function createConversation(data = {}) {
    return service({
        url: "/qa/conversations/",
        method: "POST",
        data
    })
}

// 发送反馈
export function answerBack(data) {
    return service({
        url: "/qa/feedback/",
        method: "POST",
        data
    })
}

// 获取会话的聊天记录
export function getConversationContent(id) {
    return service({
        url: `/qa/conversations/${id}/`,
        method: "GET"
    })
}

// 获取用户所有对话
export function getAllConversion(params) {
    return service({
        url: "/qa/conversations/",
        method: "GET",
        params
    })
}

// 获取最近历史记录
export function getHistory() {
    return service({
        url: "/qa/history/",
        method: "GET"
    })
}

// 发送消息 - 问答接口
export function chatAi(data) {
    return service({
        url: "/qa/ask/",
        method: "POST",
        data
    })
}
